package com.zmn.plat.persistence.interfaces.contract.record;

import com.zmn.plat.model.entity.contract.record.ContractRecord;
import com.zmn.plat.model.entity.contract.record.ContractRecordQuery;
import com.zmn.plat.model.vo.contract.record.ContractRecordVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;



/**
 * 合同表
 * 
 * @author linfeng
 *
 * @since 2020-05-09 11:41:45
 */
public interface ContractRecordDao {

    /**
     * 查询
     * @param contractId ID
     * @return
     */
    ContractRecord findByKey(Integer contractId);

    /**
     * 查询最大的排序
     *
     * @return
     */
    Integer findMaxSort();

    /**
     * 分页搜索
     * @param query 条件
     * @return 列表
     */
    List<ContractRecordVO> listPageByQuery(ContractRecordQuery query);

    /**
     * 搜索
     * @param query 条件
     * @return
     */
    List<ContractRecord> listByQuery(ContractRecordQuery query);

    /**
     * 所有数据
     * @return
     */
    List<ContractRecord> listAll();

    /**
     * 统计
     * @param query 条件
     * @return
     */
    Integer countByQuery(ContractRecordQuery query);
    /**
     * 更新状态
     *
     * @param contractRecord
     * @return
     */
    Integer updateStatusByKey(ContractRecord contractRecord);

    /**
     * 更新状态：批量
     * @param ids
     * @param status
     * @param mcStaffName
     * @return
     */
    Integer updateBatchStatusByKey(@Param("ids")List<Integer> ids, @Param("status")Integer status, @Param("staffName")String mcStaffName);
    /**
     * 更新
     * @param contractRecord
     * @return
     */
    Integer updateByKey(ContractRecord contractRecord);

    /**
     * 更新排序
     * @param contractRecord
     * @return
     */
    Integer updateSortByKey(ContractRecord contractRecord);

    /**
     * 插入
     * @param contractRecord
     * @return
     */
    Integer insert(ContractRecord contractRecord);

    /**
     * 删除
     * @param contractId ID
     * @return
     */
    Integer deleteByKey(Integer contractId);
}
